/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.st.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.List;
import com.jeesite.common.collect.ListUtils;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 销售单Entity
 * @author HOHD
 * @version 2020-12-18
 */
@Table(name="st_sale_bill", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="bill_no", attrName="billNo", label="单据号"),
		@Column(name="bill_date", attrName="billDate", label="单据日期"),
		@Column(name="sale_or_not", attrName="saleOrNot", label="销/退货"),
		@Column(name="custom_id", attrName="customId", label="客户"),
		@Column(name="sale_type", attrName="saleType", label="销售类型"),
		@Column(name="product_status", attrName="productStatus", label="生产状态"),
		@Column(name="contract_no", attrName="contractNo", label="合同编号"),
		@Column(name="bussiness_man_code", attrName="bussinessManCode", label="业务员编码"),
		@Column(name="business_man", attrName="businessMan", label="业务员"),
		@Column(name="dept_code", attrName="deptCode", label="部门编码"),
		@Column(name="dept_name", attrName="deptName", label="部门", queryType=QueryType.LIKE),
		@Column(name="money_type", attrName="moneyType", label="币别"),
		@Column(name="money", attrName="money", label="金额"),
		@Column(name="receipt", attrName="receipt", label="收款账期"),
		@Column(name="project_belong", attrName="projectBelong", label="项目归属"),
		@Column(name="address", attrName="address", label="地址"),
		@Column(name="examine", attrName="examine", label="是否做业绩考核"),
		@Column(name="delivery_date", attrName="deliveryDate", label="交货日期"),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false),
		@Column(name="remarks", attrName="remarks", label="备注信息", queryType=QueryType.LIKE),
	}, orderBy="a.update_date DESC",joinTable = {
		@JoinTable(on = "custom.id=a.custom_id",entity = StCustomRecord.class,attrName = "custom",alias = "custom",type = Type.LEFT_JOIN)
}
)
public class StSaleBill extends DataEntity<StSaleBill> {
	
	private static final long serialVersionUID = 1L;
	private String billNo;		// 单据号
	private Date billDate;		// 单据日期
	private Integer saleOrNot;		// 销/退货
	private String customId;		// 客户
	private StCustomRecord custom;
	private Integer saleType;		// 销售类型
	private Integer productStatus;		// 生产状态
	private String contractNo;		// 合同编号
	private String bussinessManCode;		// 业务员编码
	private String businessMan;		// 业务员
	private String deptCode;		// 部门编码
	private String deptName;		// 部门
	private Integer moneyType;		// 币别
	private Double money;		// 金额
	private String receipt;		// 收款账期
	private String projectBelong;		// 项目归属
	private String address;		// 地址
	private Integer examine;		// 是否做业绩考核
	private Date deliveryDate;		// 交货日期
	private List<StSaleBillDetail> stSaleBillDetailList = ListUtils.newArrayList();		// 子表列表
	
	public StSaleBill() {
		this(null);
	}

	public StSaleBill(String id){
		super(id);
	}
	
	@Length(min=0, max=20, message="单据号长度不能超过 20 个字符")
	public String getBillNo() {
		return billNo;
	}

	public void setBillNo(String billNo) {
		this.billNo = billNo;
	}

	public StCustomRecord getCustom() {
		return custom;
	}

	public void setCustom(StCustomRecord custom) {
		this.custom = custom;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBillDate() {
		return billDate;
	}

	public void setBillDate(Date billDate) {
		this.billDate = billDate;
	}
	
	public Integer getSaleOrNot() {
		return saleOrNot;
	}

	public void setSaleOrNot(Integer saleOrNot) {
		this.saleOrNot = saleOrNot;
	}
	
	@Length(min=0, max=36, message="客户长度不能超过 36 个字符")
	public String getCustomId() {
		return customId;
	}

	public void setCustomId(String customId) {
		this.customId = customId;
	}
	
	public Integer getSaleType() {
		return saleType;
	}

	public void setSaleType(Integer saleType) {
		this.saleType = saleType;
	}
	
	public Integer getProductStatus() {
		return productStatus;
	}

	public void setProductStatus(Integer productStatus) {
		this.productStatus = productStatus;
	}
	
	@Length(min=0, max=20, message="合同编号长度不能超过 20 个字符")
	public String getContractNo() {
		return contractNo;
	}

	public void setContractNo(String contractNo) {
		this.contractNo = contractNo;
	}
	
	@Length(min=0, max=20, message="业务员编码长度不能超过 20 个字符")
	public String getBussinessManCode() {
		return bussinessManCode;
	}

	public void setBussinessManCode(String bussinessManCode) {
		this.bussinessManCode = bussinessManCode;
	}
	
	@Length(min=0, max=5, message="业务员长度不能超过 5 个字符")
	public String getBusinessMan() {
		return businessMan;
	}

	public void setBusinessMan(String businessMan) {
		this.businessMan = businessMan;
	}
	
	@Length(min=0, max=20, message="部门编码长度不能超过 20 个字符")
	public String getDeptCode() {
		return deptCode;
	}

	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}
	
	@Length(min=0, max=20, message="部门长度不能超过 20 个字符")
	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
	
	public Integer getMoneyType() {
		return moneyType;
	}

	public void setMoneyType(Integer moneyType) {
		this.moneyType = moneyType;
	}
	
	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}
	
	@Length(min=0, max=36, message="收款账期长度不能超过 36 个字符")
	public String getReceipt() {
		return receipt;
	}

	public void setReceipt(String receipt) {
		this.receipt = receipt;
	}
	
	@Length(min=0, max=20, message="项目归属长度不能超过 20 个字符")
	public String getProjectBelong() {
		return projectBelong;
	}

	public void setProjectBelong(String projectBelong) {
		this.projectBelong = projectBelong;
	}
	
	@Length(min=0, max=40, message="地址长度不能超过 40 个字符")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	public Integer getExamine() {
		return examine;
	}

	public void setExamine(Integer examine) {
		this.examine = examine;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getDeliveryDate() {
		return deliveryDate;
	}

	public void setDeliveryDate(Date deliveryDate) {
		this.deliveryDate = deliveryDate;
	}
	
	public List<StSaleBillDetail> getStSaleBillDetailList() {
		return stSaleBillDetailList;
	}

	public void setStSaleBillDetailList(List<StSaleBillDetail> stSaleBillDetailList) {
		this.stSaleBillDetailList = stSaleBillDetailList;
	}
	
}